package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.web.domain.ExecutionSuccess;
import com.ruoyi.web.mapper.ExecutionSuccessMapper;
import com.ruoyi.web.service.IExecutionSuccessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

import javax.annotation.Resource;

/**
 * 扣款成功Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-24
 */
@Service
public class ExecutionSuccessServiceImpl implements IExecutionSuccessService
{
    @Resource
    private ExecutionSuccessMapper executionSuccessMapper;

    /**
     * 查询扣款成功
     * 
     * @param id 扣款成功主键
     * @return 扣款成功
     */
    @Override
    public ExecutionSuccess selectExecutionSuccessById(Long id)
    {
        return executionSuccessMapper.selectExecutionSuccessById(id);
    }

    /**
     * 查询扣款成功列表
     * 
     * @param executionSuccess 扣款成功
     * @return 扣款成功
     */
    @Override
    public List<ExecutionSuccess> selectExecutionSuccessList(ExecutionSuccess executionSuccess)
    {
        return executionSuccessMapper.selectExecutionSuccessList(executionSuccess);
    }

    /**
     * 新增扣款成功
     * 
     * @param executionSuccess 扣款成功
     * @return 结果
     */
    @Override
    public int insertExecutionSuccess(ExecutionSuccess executionSuccess)
    {
        executionSuccess.setCreateTime(DateUtils.getNowDate());
        executionSuccess.setCreateBy(ShiroUtils.getSysUser().getLoginName());
        return executionSuccessMapper.insertExecutionSuccess(executionSuccess);
    }

    /**
     * 修改扣款成功
     * 
     * @param executionSuccess 扣款成功
     * @return 结果
     */
    @Override
    public int updateExecutionSuccess(ExecutionSuccess executionSuccess)
    {
        executionSuccess.setUpdateTime(DateUtils.getNowDate());
        return executionSuccessMapper.updateExecutionSuccess(executionSuccess);
    }

    /**
     * 批量删除扣款成功
     * 
     * @param ids 需要删除的扣款成功主键
     * @return 结果
     */
    @Override
    public int deleteExecutionSuccessByIds(String ids)
    {
        return executionSuccessMapper.deleteExecutionSuccessByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除扣款成功信息
     * 
     * @param id 扣款成功主键
     * @return 结果
     */
    @Override
    public int deleteExecutionSuccessById(Long id)
    {
        return executionSuccessMapper.deleteExecutionSuccessById(id);
    }

    /*
    * 清空表
    * */
    @Override
    public void truncateTable(String loginName){
        executionSuccessMapper.truncateTable(loginName);
    }
}
